from graphics import *
import time

def main():
    win = GraphWin()
    ball = Circle(Point(0,0), 5)
    ball.setFill('blue')
    ball.draw(win)

    while True:
        mouse = win.checkMouse() # Get last mouse position.
        if mouse is not None:
            ball.move(mouse.getX() - ball.getCenter().getX(), mouse.getY() - ball.getCenter().getY())

        ball.move(1,1)
        time.sleep(0.05)

main()
